A short presentation and then a demo:
- About Us
- Intro
- The Problem: Operationalizing Predictive Models
- Solutions
- Case Study: Iris Flower Predictor
- Demo
- Q & A
September 30, 2015
A short presentation and then a demo:
Common examples of data products:
library(xtable) data(iris) print(xtable(head(iris, 5)), type = "html", include.rownames = F)
| Sepal.Length | Sepal.Width | Petal.Length | Petal.Width | Species |
|---|---|---|---|---|
| 5.10 | 3.50 | 1.40 | 0.20 | setosa |
| 4.90 | 3.00 | 1.40 | 0.20 | setosa |
| 4.70 | 3.20 | 1.30 | 0.20 | setosa |
| 4.60 | 3.10 | 1.50 | 0.20 | setosa |
| 5.00 | 3.60 | 1.40 | 0.20 | setosa |
Web Sample http://bit.ly/1YPQFJu
supplied by heroku
or run it yourself
MODEL_ATTRS = [ 'sepal_length', 'sepal_width',
'petal_length', 'petal_width' ]
if request.method == 'POST': # you submitted the form
attributes = [] # just the values from the form in an array
for field in MODEL_ATTRS:
attributes.append(request.form[field])
result = fetch_score(attributes)
result = result.json()
API_KEY = 'KaxzbZ3bu1VNF7yUpQ3TmtUl6reJjp6xjHLoCnPUhsVbrE6nJ9wjGg31FW6cCDcZ'
def fetch_score(attributes):
return requests.post(
"https://app.dominodatalab.com/v1/SparkIQLabs/helloWorld/endpoint",
headers = {
'X-Domino-Api-Key': API_KEY,
'Content-type': 'application/json'
},
json={ "parameters": attributes }
)